home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / hack / 3_1_3 / sys / msdos / install.dos < prev    next >
Encoding:
Text File  |  1993-07-12  |  21.3 KB  |  437 lines

  1.     SCCS Id: @(#)Install.dos     3.1        93/07/07
  2.  
  3.         Copyright (c) NetHack PC Development Team 1990 - 1993.
  4.        NetHack may be freely redistributed.  See license for details.
  5.        ==============================================================
  6.               Instructions for compiling and installing
  7.                     NetHack 3.1 on an MS-DOS system
  8.          ======================================================
  9.                   (or, How to make PC NetHack 3.1)
  10.                      Last revision: July 11, 1993
  11.  
  12. Credit for a runnable full PC NetHack 3.1 goes to the PC Development team
  13. of Norm Meluch, Kevin Smolkowski, Paul Winner, Michael Allison and Steve
  14. VanDevender who built on the work of Pierre Martineau, Stephen Spackman,
  15. Steve Creps, Mike Threepoint and Don Kneller.
  16.  
  17. I.  Dispelling the Myths:
  18.  
  19.     Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
  20.     however it will behoove you to read this entire file through before
  21.     beginning the task.
  22.  
  23.     We have provided the proper makefiles for building NetHack using the
  24.     following compilers:
  25.  
  26.     Microsoft C 6.0a
  27.     Microsoft C 7.0 and Microsoft Visual C++ Professional (MSVC) 1.0
  28.     DJGPP       1.9 or later
  29.  
  30.     For specific details concerning each compiler, please see the
  31.     corresponding appendix.
  32.  
  33.     All the makefiles were created for use with NDMAKE.  The make programs
  34.     provided by the various vendors all seem to lack necessary features,
  35.     or differ enough in their syntax that the supplied makefiles won't
  36.     work.  That is the case with 'nmake' supplied with the MSC compiler.  
  37.     NDMAKE is available free from your local archive site.
  38.  
  39.     If you want to build a copy of NetHack that is identical to the
  40.     "official binaries", please see appendix A.
  41.  
  42.     You may find it useful to obtain copies of lex (flex) and yacc (bison).
  43.     While not strictly necessary to compile nethack, they are required should
  44.     you desire to make any changes to the level and dungeon compilers.
  45.     Flex and Bison are included with the DJGPP distribution and are also
  46.     available on many archive sites.
  47.  
  48. II. To compile your copy of NetHack on a MSDOS machine:
  49.     (or "just follow these few 'simple' steps outlined below.")
  50.  
  51. 1.  It almost goes without saying that you should make sure that your tools
  52.     are set up and running correctly.
  53.  
  54. 2.  Make sure all the NetHack files are in the appropriate directory
  55.     structure.  You should have a main directory with subdirectories
  56.     dat, doc, include, src, sys\share, sys\msdos, util and win\tty.
  57.     Other subdirectories may also be included in your distribution, but
  58.     they are not necessary for use with MSDOS.  You can delete them
  59.     to save space.  If you are using MSC7 or MSVC, the makefile will create
  60.     an additional directory src\o.
  61.  
  62.     Check the file "Files" in your top level directory for an exact
  63.     listing of what file is in which directory.  In order for the
  64.     Makefiles to work, all the source files must be in the proper
  65.     locations.
  66.  
  67.     If you downloaded or ftp'd the sources from a UNIX system, the lines
  68.     will probably end in UNIX-style newlines, instead of the carriage
  69.     return and line feed pairs used by DOS.  Some programs have trouble
  70.     with them, so you may need to convert them (with a utility like
  71.     Rahul Dhesi's "flip").  Also, every file should end with an empty
  72.     line, because both Microsoft C and MASM have a habit of ignoring the
  73.     last line of each file. 
  74.  
  75. 3.  The file termcap.uu is the fixed version of the Fred Fish termcap library.
  76.     You will need to run a uudecode utility on it to generate the file
  77.     termcap.zip.  termcap.zip contains several files of termcap routines.
  78.     Using them with NetHack involves very little knowledge of the UNIX concept
  79.     of a termcap database; mostly you need to know enough to set a TERM
  80.     environment variable.  You can unzip termcap.zip in the sys/share
  81.     directory, but if you are going to use it, it is probably better to
  82.     unzip a copy in a special directory and copy the library files to where
  83.     your linker can find them.
  84.  
  85.     Makefiles are included should you want to build your own termcap
  86.     library file.  Makemsc.lib works with Microsoft C (MSC and MSVC)
  87.     and generates termcap.lib, Makegcc.lib works with DJGPP and generates
  88.     libtermc.a.
  89.  
  90.     Note that you only need the termcap library if you have changed 
  91.     pcconf.h to define TERMLIB, and commented out the #define NO_TERMS 
  92.     (See point 6).
  93.  
  94. 4.  ovlmgr.uu (MS-DOS overlay manager) is the uuencoded assembled
  95.     object module for the overlay manager used with Microsoft C 6.0
  96.     and older.  This file is provided in case you do not have an assembler
  97.     of your own.  You will need to run a uudecode utility on this file too,
  98.     to generate ovlmgr.obj.  If you want to use this, put the ovlmgr.obj
  99.     in the src directory; the makefile will access it when it needs it.
  100.  
  101. 5.  Go to the sys/msdos directory and run the setup.bat batch file
  102.     with either MSC or GCC as the argument.  The necessary Makefile
  103.     movements will be accomplished for you.  In addition, when used
  104.     with the MSC option, certain compiler options will be set.  Make
  105.     sure that you either run setup.bat each time you start compiling
  106.     or copy the line that starts "SET CL" into your autoexec.bat file.
  107.  
  108. 6.  Now go to the include subdirectory to check a couple of the header
  109.     files there.  Things *should* work as they are, but since you have
  110.     probably set up your system in some sort of custom configuration
  111.     it doesn't hurt to check out the following:
  112.  
  113.     First check config.h according to the comments to match your system and
  114.     desired set of features.  Mostly you need to check the WIZARD option,
  115.     make sure the HACKDIR is set properly or disabled, and check TERMLIB
  116.     and COMPRESS.
  117.  
  118.     We've managed to enable all the special features.  You may include all
  119.     or as few of them as you wish.  To conserve disk space, you may wish
  120.     to disable LOGFILE and NEWS.
  121.  
  122.     Also check pcconf.h, which should not need much editing (if you are
  123.     including random.c, and if you do not require termcap for screen
  124.     management).  If you are not including random.c you will need to 
  125.     comment out RANDOM. 
  126.  
  127.     There are several options available for screen management with this
  128.     release of PC NetHack.  The features #define TERMLIB, #define
  129.     ANSI_DEFAULT, and #define NO_TERMS in pcconf.h control the various
  130.     options.
  131.  
  132.     The NO_TERMS feature (the default) has the advantage of not needing the
  133.     DEVICE=ANSI.SYS statement in config.sys.  The supplied sources and
  134.     header files are distributed with support for NO_TERMS enabled.  
  135.     NO_TERMS will not work with TERMLIB, nor with ANSI_DEFAULT defined.  
  136.     The NO_TERMS feature uses internal routines for screen management, and 
  137.     may be an ideal choice if your play machine is industry standard (has 
  138.     an IBM compatible BIOS).
  139.  
  140.     Should you choose to leave NO_TERMS defined, define only one of the two 
  141.     screen access methods.  If compiling for Microsoft compilers, use
  142.     SCREEN_BIOS; if using DJGPP, you can choose between SCREEN_BIOS
  143.     and SCREEN_DJGPPFAST.  Never, never, ever choose both.  Bad things
  144.     will happen.
  145.  
  146.     If you leave the #define TERMLIB commented in pcconf.h to disable use
  147.     of termcap routines, then your screen management must rely on either 
  148.     the NO_TERMS feature described above, or the ANSI_DEFAULT feature.  
  149.     Either of these will make your job a bit easier than if you choose to 
  150.     use TERMLIB.  If you elect to include TERMLIB support, you may compile 
  151.     with both TERMLIB and ANSI_DEFAULT, and simply not set your TERM variable 
  152.     if you do not wish to use the termcap file settings.  You will need
  153.     to uudecode the termcap library in sys\share if you are using the TERMLIB
  154.     feature.  
  155.     
  156.     If you are using a Microsoft compiler you should make doubly certain
  157.     that OVERLAY is defined in pcconf.h, since otherwise things will 
  158.     compile properly but very ugly things are likely to happen wherever
  159.     function pointers cross overlay boundaries - the linker is a little 
  160.     thick about that.
  161.  
  162.  
  163. 7.  If you want to change the high score list behavior, examine the top of
  164.     topten.c, in the src directory.  You may want to change the definitions of
  165.     PERSMAX, POINTSMIN, and ENTRYMAX.  I set POINTSMIN to 51 and ENTRYMAX to
  166.     50 to keep the size of the score list down.
  167.  
  168. 8.  Go to the src directory and edit the top of your Makefile.  Be sure the
  169.     directory you want the game installed (GAMEDIR) in actually exists.
  170.  
  171.     If you elected not to use the high-quality BSD random number routines by
  172.     commenting out RANDOM in pcconf.h or tosconf.h, comment out (or set equal
  173.     to nothing) the RANDOM macro in your Makefile.
  174.  
  175.     If you elected to use termcap (TERMLIB defined), then uncomment the 
  176.     TERMLIB macro in your Makefile that points to the location of the
  177.     library.
  178.     
  179.     That is,    TERMLIB =
  180.     should be   TERMLIB = (SSYS)\termlib.lib
  181.  
  182.     If you are recompiling after patching your sources, or if you got your
  183.     files from somewhere other than the official distribution, "touch
  184.     makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
  185.     lest potentially troublesome timestamps fool "make".
  186.  
  187. 9.  Now that everything is set up, go to the util directory and
  188.     run ndmake.  If you get any errors along the way then something
  189.     has not been set correctly.  Next do the same in the dat directory.
  190.     Finally, go to the src directory and "make install".  Depending on
  191.     your particular machine and compiler, you can either grab a cup
  192.     of coffee or go home for the day.  Your computer will be occupied
  193.     for a long time.  If all goes well, you will get an NetHack executable.
  194.  
  195. 10. Make sure the support files -- data, rumors, cmdhelp, opthelp, help, hh,
  196.     history, and license -- were copied to the game directory.  If not,
  197.     move them there from the dat directory yourself.  rumors. can be
  198.     created manually be entering "makedefs -r", data. by entering
  199.     "makedefs -d".
  200.  
  201.     Make sure the files NetHack.cnf and termcap also made it to your game
  202.     directory.  If not, go to sys\share and copy NetHack.cnf and
  203.     termcap to your game directory.  Edit NetHack.cnf to reflect your
  204.     particular setup and personal preferences, by following the comments.
  205.  
  206.     Also, make sure the file msdos.hlp made it to your game directory.
  207.     If it didn't, move it from sys\msdos to your game directory
  208.     yourself.
  209.  
  210.     If you'll be running NetHack from a different subdirectory, you will
  211.     want to "set HACKDIR=c:\games\nethack" (or whatever drive and directory 
  212.     you want to use) now.  Add it to your autoexec.bat (in DOS), as you'll
  213.     be playing often.
  214.  
  215. 11. Play NetHack.  If it works, you're done!
  216.  
  217. Appendix A - Building the "offical binaries"
  218.  
  219.     If you wish to build a copy of NetHack identical to the ones that
  220.     the pc team distributes, observe the following:
  221.  
  222.     For the binary built with Microsoft C 7.00, make no changes to
  223.     any of the defines.  
  224.  
  225.     For the 386 binary built with DJGPP, set the following
  226.     - include/pcconf.h
  227.       comment out #SCREEN_BIOS
  228.       define SCREEN_DJGPPFAST
  229.  
  230.     Make sure the following files have been converted from the
  231.     unix style "^J" end of line, to the msdos style "^M^J":
  232.       license, help, hh, termcap, history, cmdhelp wizhelp and
  233.       nethack.cnf.
  234.  
  235.     Uudecode nhico.uu nhpif.uu.
  236.  
  237.     Place all the files in a clean directory and test.
  238.  
  239. Appendix B - Microsoft C Compilers
  240.  
  241.     You can compile NetHack using almost any version of Microsoft C later
  242.     than 5.1, including Microsoft Visual C++ Professional 1.0.  MSC Versions
  243.     5.0 and earlier are broken in such a way that it is impossible to use 
  244.     them.  Version 6.0 requires a patch available from Microsoft; after 
  245.     applying you should have 6.0ax.  
  246.     
  247.     MSC Version 7.0 works with or without the August 1992 patch. 
  248.  
  249.     MSVC Professional 1.0 works as distributed, although there seems 
  250.     to be a problem with the compiler having problems and stopping the 
  251.     compile periodically.  Things proceed normally after starting 'make'
  252.     once again.  The problem, although annoying, does not affect the code
  253.     generation or the final executable.
  254.  
  255.     Officially, support is no longer provided for MSC versions prior to
  256.     6.0ax.  NetHack v3.1 will compile with 5.1, but you will need to
  257.     make a lot of modifications to the makefiles in order to avoid heap
  258.     space problems.  We strongly recommend upgrading to 6.0ax if you
  259.     intend to recompile NetHack often.
  260.  
  261.     One Makefile is used for all versions.  MSC Version 7.0 and MSVC take 
  262.     advantage of the CL environment variables to set the compiler flags, 
  263.     as they exceed the MSDOS limitation of 128 characters on the command 
  264.     line.  Please read the Makefile carefully and select those options that
  265.     go with the compiler.  Also, remember to run setup.bat to set the
  266.     CL environment variable before you compile.
  267.  
  268.     We use the following Makefiles:
  269.     MakeMSC.src  - src directory
  270.     MakeMSC.utl  - util directory
  271.     Makefile.dat - dat directory
  272.  
  273.     The Makefile uses a structured break-up of the object modules so that
  274.     we can link heavily used functions together without actual source code
  275.     movement.  This has provided a great speed improvement for this release.
  276.     See the file sys\msdos\ovlmgr.doc for more information on this
  277.     structuring.
  278.  
  279.   Microsoft C version 6.0:
  280.     The NetHack executable that you are about to get will be generated by an
  281.     overlay linker.  The beauty of this overlay linker beastie is that it will
  282.     create an executable that will function in much less memory than it would
  283.     "normally" take to run.  Do not be deceived.  The RAM requirement for the
  284.     overlay version is about 550k!  You can load the program in less RAM, but
  285.     you will begin to experience a serious amount of disk thrashing at 530k
  286.     or less.  Absolute minimum will probably be in the neighborhood of 380-400k.
  287.     You do not want to run the program like that!  The more free RAM you have
  288.     available for the program, the more smoothly it will run.
  289.  
  290.     Microsoft's internal overlay management scheme was pretty useless prior
  291.     to version 7.0.  However, the sheer size of NetHack requires some sort
  292.     of overlay scheme.  The magic piece to this puzzle is a program called
  293.     ovlmgr.asm.  This is a replacement for the Microsoft (and we use the
  294.     term loosely) overlay manager.  This program has been enhanced since
  295.     its release in November 1989.  It will now allow NetHack to use EMS
  296.     memory if any is available.  Also, the overlay manager will now read
  297.     overlays out of files completely separate from the EXE.  This will
  298.     cut down on the size of files for NetHack making distribution to PCs
  299.     with low density disk drives much easier.
  300.  
  301.     If you have a MASM compatible Assembler, you may want to enable the option
  302.     in the makefile to rebuild ovlmgr.obj, although a ready-made object file 
  303.     is provided for those of you without.  Before assembling ovlmgr, be sure
  304.     to read ovlmgr.doc as there are several options that you may or may not
  305.     wish to enable/disable.
  306.  
  307.   Microsoft C version 7.0
  308.     Microsoft was finally able to come out with a workable overlay
  309.     linker in version 7.0.  Instead of linking in the custom overlay
  310.     manager, we just let Microsoft do the work.
  311.  
  312.   Microsoft Visual C++ Professional version 1.0
  313.     The Microsoft Visual C++ Professional compiler can utilize the same
  314.     Makefiles and instructions for compiling as Microsoft C version 7.0.
  315.  
  316. Appendix C - DJGPP Compiler (gcc ported to msdos)
  317.  
  318.     If you have a 386 or better machine, you are in luck.  You can compile
  319.     NetHack without spending money on a compiler.  DJGPP is available free
  320.     from many archive sites.
  321.  
  322.     Setting up DJGPP is more than adequately explained in the documentation
  323.     that comes with it.  Be sure to pick up the yacc and flex built with
  324.     DJGPP if you intend to do any modification of the special levels or
  325.     dungeon compilers.  They should be available at the same place you got
  326.     djgpp.
  327.  
  328.     The latest version of djgpp, 1.10, will produce a binary that will
  329.     run under Microsoft Windows.
  330.  
  331.     If you want to use the built-in DJGPP screen routines, uncomment
  332.     SCREEN_DJGPPFAST in pcconf.h.  Note that some of these routines
  333.     are broken under early versions of the compiler, so we pick and 
  334.     choose the ones that work.  See video.c for details. 
  335.  
  336. Appendix D - Borland C Compiler
  337.  
  338.     NetHack will not compile at all with any version of Turbo C/C++.  It
  339.     has been made to compile with Borland C v2.0 after much work, but the
  340.     resulting binaries are far too slow to be playable.  It will not compile
  341.     with Borland C/C++ v3.0 - the bugs in that version of the compiler
  342.     related to the preprocessor make a total mess out of the macros that
  343.     the NetHack code is laced with.  We haven't had much luck at
  344.     compiling with v3.1 either.  If you successfully compile a playable
  345.     binary using any version of Borland's compiler we would love to
  346.     hear from you -- it would be a sure ticket to a position on the PC
  347.     Development team and all the fame and fortune that goes along with
  348.     it.  To get you started, here are a few hints.
  349.  
  350.     0. This should almost go without saying, but if you just bought
  351.        Borland (or Turbo C) and you are thinking that compiling
  352.        NetHack would be a great way to learn C and your nifty new
  353.        compiler at the same time, you are either going to prove
  354.        yourself some kind of prodigy or get very frustrated and quit.
  355.  
  356.     1. We left most of the __TURBOC__ defines in the code, some are
  357.        necessary, others are not, and a few are misleading depending
  358.        upon which compiler version you use as they relate to problems
  359.        with Borland compilers long since fixed.  We left them in to
  360.        provide some landmarks for future Borland hackers.
  361.  
  362.     2. No makefiles are provided as nothing we have tried has really
  363.        worked.  Most of our attempts have started off using the
  364.        GCC makefiles.
  365.  
  366.     3. Start off by working with the utility programs in the util
  367.        directory.  They are the smallest and will give you some
  368.        measure of success before you tackle the main code.  The
  369.        programs contained in util are necessary to build the
  370.        game so you will not be wasting your time.  Once you get
  371.        the utility program compiled, run the makefile in the dat
  372.        directory.  The utility programs you just compiled will attempt
  373.        to convert the raw data files into game readable form.  If you
  374.        get errors then something is wrong.
  375.  
  376. Appendix E - Microsoft C Compiler Warnings
  377.  
  378.     If you are using MSC for your compile with any of the /W levels set,
  379.     you can expect warnings.  The list below are those warnings that we
  380.     are aware of and our recommendation for dealing with them.  You can
  381.     use the warning disable pragma to ignore them if you wish.  (NOTE:
  382.     this is not a complete list of all warnings you might receive, only
  383.     those for which we feel we can safely provide guidance on.)
  384.  
  385. C4131 (function:uses old-style declarator)
  386.     You should ignore this warning.  In order to make the source code as
  387.     portable as possible, only old-style declarators are used so that as
  388.     many compilers as possible can use the same code.
  389. C4706 (Assignment within conditional expression)
  390.     This is a perfectly valid construction.  These warnings have not
  391.     produced any problems.
  392. C4761 (Integral size mismatch in argument; conversion supplied)
  393.     These should be no problem.  Prototyping compilers will do the con-
  394.     version, and non-prototyping compilers will go through int anyway.
  395.  
  396.  
  397. Notes:
  398.  
  399. 1)  Save files and bones files from previous versions of NetHack will not
  400.     work with this NetHack.  Don't bother trying to keep them.  Record
  401.     (score) files from before 3.0 patchlevel 7 will almost work, but you need
  402.     to make one change manually to them:  At the end of each line is a word or
  403.     phrase specifying what killed the player.  Change the string to start with
  404.     the words "killed by", "killed by a", or "killed by an" (whichever is
  405.     appropriate).  If the death was petrification, it should read "petrified
  406.     by" instead of "killed by".  Don't change "starvation", "quit", "escaped",
  407.     or "ascended".
  408.  
  409. 2)  To install an update of NetHack after changing something, enter "make45l"
  410.     from the src directory.  If you add, delete, or reorder monsters or
  411.     objects, or you change the format of saved level files, delete any save
  412.     and bones files.  (Trying to use such files sometimes produces amusing
  413.     confusions on the game's part, but usually crashes.)
  414.  
  415.     If you made changes to any of the level compiler software, you may have
  416.     to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the
  417.     util directory to ensure that they are remade.
  418.  
  419. 3)  During linking the Microsoft Overlay Linker will need temporary storage
  420.     space.  Make sure you have about a meg of free disk wherever you have
  421.     defined your temporary storage.
  422.  
  423. 4)  If you have comments or suggestions, feel free to drop any one of
  424.     us a line c/o nethack-bugs@linc.cis.upenn.edu.  From compuserve,
  425.     try INTERNET:nethack-bugs@linc.cis.upenn.edu.  Should you be
  426.     without email access, some of us can still be reached by lesser means:
  427.  
  428.     For the west coast:
  429.       Kevin D Smolkowski
  430.       c/o OSLC
  431.       207 E 5th
  432.       Eugene, OR  97401
  433.  
  434.     Compuserve users can also reach Paul Winner by sending compuserve mail
  435.     to 73207,226.  The NetHack binaries and sources can be found in the
  436.     GAMERS forum.
  437.